package com.fimmlps.reronge.dto;

import com.fimmlps.reronge.entity.EntryUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class EntryUserDto {
    private Integer userId;

    private String userName;
    private String userPassword;
    private String userEmail;
    private LocalDateTime userCreateTime;
    private Integer userAdmin;
    private Integer userEditor;
    private String authorization;

    public EntryUserDto(EntryUser user, String authorization){
        setUserId(user.getUserId());
        setUserName(user.getUserName());
        setUserPassword(user.getUserPassword());
        setUserEmail(user.getUserEmail());
        setUserCreateTime(user.getUserCreateTime());
        setUserAdmin(user.getUserAdmin());
        setUserEditor(user.getUserEditor());
        setAuthorization(authorization);
    }
}
